package org.opens;

import java.sql.Driver;
import java.util.Iterator;
import java.util.ServiceLoader;

/**
 * @Date 2020/10/31 21:14
 * @Created by 99126
 */
public class SPITest {

    public static void main(String[] args) {
        ServiceLoader<Driver> serviceLoader = ServiceLoader.load(Driver.class);
        Iterator<Driver> iterator = serviceLoader.iterator();
        System.out.println(iterator.hasNext());
        while(iterator.hasNext()){
            Driver driver = iterator.next();
            System.out.println(driver.getMajorVersion());
            System.out.println(driver.getClass().getClassLoader());
        }
    }

}
